package nf;

import imageprocessing.DePaper;

import java.awt.image.BufferedImage;

class DePaperer implements ImagePreprocessor
{
	private float blurFactor = 0.1f; //0.25f;
	private float contrastFactor = 0.5f;
	private int bwThreshold = 230;

	@Override
	public BufferedImage processImage(BufferedImage source) {
		
		if(source == null) return null;
		
		BufferedImage result = DePaper.process(source, blurFactor, contrastFactor, false);
		return DePaper.thresholdBW(result, bwThreshold, false);
	}

}
